home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 4 / ETO Development Tools 4.iso / Essentials / MacApp Documentation / MacApp.TECH$ Archives / 1989 / Nov 89 / 0039-MacApp Debugger and -Nov89 < prev    next >
Encoding:
Text File  |  1991-03-06  |  2.4 KB  |  55 lines  |  [TEXT/GEOL]

  1. Item forwarded  by  A33          to A34
  2.  
  3. Item    2746442                         5-Nov-89        09:10
  4.  
  5. From:   THOUGHT.SHOP                    Thought Shop, Arvid Jedlicka,PRT
  6.  
  7. To:     MACAPP.TECH$                    MacApp Technical
  8.  
  9. Sub:    MacApp Debugger and 'ci'
  10.  
  11. I hope this is still in time for the "Tacky Patch of the Week" award.
  12.  
  13. It appears as though the 'ci' implements the 'Debugger' and 'DebugStr' traps
  14. differently than other Mac's.  Both traps have the same address as
  15. 'Unimplemented' when using NGetTrapAddress or MacsBug, even though the traps
  16. work.  ( How this happens is left as a project for the reader. )
  17.  
  18. This effects the MacApp debugger.  From the debugger, an 'E' will allow you to
  19. enter MacsBug.  Being a robust applicaton ( from Meyer's book ), MacApp checks
  20. to see that 'DebugStr' is implemented before it makes the call.  On the 'ci',
  21. it looks like the trap is unimplemented, and you get a message 'MacsBug isn't
  22. available', which is not the real picture.
  23.  
  24. Another method to determine if a debugger's installed was needed.  Checking the
  25. MacsBug manual, there is a low memory longint variable called MacJmp ( $0120 )
  26. that holds debugger information.  The upper byte has flags, and the lower three
  27. bytes contain the address of the debugger.  Being a 32-bit clean machine, the
  28. 'ci' seems to have moved the flags somewhere else, but does put what looks like
  29. an address in the four bytes if a debugger is installed, and nil if it's not.
  30. On the older 'II' I have, the flags and address appear if installed, and
  31. $80000000 appears if not installed.  I'm not sure if this is caused by the
  32. difference in ROM's or the difference in system 6.0.3 on the 'II' and 6.0.4 on
  33. the 'ci'.
  34.  
  35. Anyway, the following patch was applied to UDebug.inc1.p, procedure DoWaiting.
  36. As this patch violates several rules ( Patching MacApp source code and Directly
  37. accessing low memory variables ) I don't recommend it.  It's a 'Here's what
  38. broke, Here's how I fixed it, I'm waiting to hear's what others say' type of
  39. deal.
  40.  
  41. 'E':
  42.   BEGIN
  43.   {$IFC FALSE}                                                {Patch}
  44.   IF TrapExists(_DebugStr) THEN                               {Patch}
  45.   {$ELSEC}                                                    {Patch}
  46.    IF ( BAND(Ord4(Handle($00000120)^),$7FFFFFFF) <> 0 ) THEN   {Patch}
  47.   {$ENDC}                                                     {Patch}
  48.     BEGIN
  49.     ....
  50.    END;
  51.  
  52. Thanks, Arvid Jedlicka
  53. The Thought Shop
  54.  
  55.